﻿using System.Configuration;

namespace K3R.Web.Interface {
	public static class Settings {
		private static InterfaceConfig _interfaceConfig = null;
		private static ProfileCollection _interfaceProfiles = null;

		public static ProfileCollection Profiles {
			get {
				if (_interfaceProfiles == null) {
					if (_interfaceConfig == null)
						_interfaceConfig = ConfigurationManager.GetSection("k3r.web.interface") as InterfaceConfig;

					if (_interfaceConfig != null)
						_interfaceProfiles = Profile.Convert(_interfaceConfig.Profiles);
				}

				return _interfaceProfiles;
			}
		}
	}
}
